<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <h:head>
        <title>Crear Perfil</title>
        <link rel="stylesheet" href="Data\\CSS\\content.css" type="text/css"/>
        <link rel="stylesheet" href="Data\\CSS\\ui-layout.css" type="text/css"/>
    </h:head>
    <h:body>
         <p:growl id="msgCP" showDetail="true" life="7000"/>

        <p:outputLabel value="Nombre del Perfil: *" style="color: #2480BC; font-weight: bold; font-size: 1.3em;"/>
        <p:inputText value="#{createProfile.profile}" required="true"/>
        
        <h:panelGrid style="margin: 0 auto">
            <p:outputLabel value="Recursos" style="color: #2480BC; font-weight: bold; font-size: 1.3em;"/>
         </h:panelGrid>
        
         <p:dataTable var = "pair" value="#{createProfile.list}"
                         paginator="true" rows="8" 
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="6, 8, 10, 12"
                         editable="true">
             <p:ajax event="rowEdit" listener="#{createProfile.onEdit}" />
             <p:ajax event="rowEditCancel" listener="#{createProfile.onCancel}"  />
             
             <p:column headerText="Nombre">
                        
                <h:outputText value="#{pair.name}"/>

            </p:column>
             
            <p:column headerText="Limite">
                <p:cellEditor>
                    <f:facet name="output" >
                        <h:outputText value="#{pair.value}"/>
                    </f:facet>

                    <f:facet name="input" >
                        <p:inputText value="#{pair.value}"
                                     style="width: 100%" />
                    </f:facet>
                </p:cellEditor>
            </p:column>
             
            <p:column style="width:6%">  
                    <p:rowEditor >
                    </p:rowEditor>
                    
            </p:column>
             
         </p:dataTable>
         <p:commandButton value="Crear"  ajax="false"
                          action="#{createProfile.create()}" 
                         style="margin-top:5px"
                         update="msgCR"/>  
    </h:body>
</html>
